import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.SwingConstants;

import java.awt.Font;

import javax.swing.JButton;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.IOException;


public class ConverterGUI extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -935694217356482087L;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ConverterGUI frame = new ConverterGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public ConverterGUI() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 400, 125);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JLabel lblConverters = new JLabel("Converters");
		lblConverters.setFont(new Font("Tahoma", Font.PLAIN, 24));
		lblConverters.setHorizontalAlignment(SwingConstants.CENTER);
		contentPane.add(lblConverters, BorderLayout.NORTH);
		
		JPanel panel = new JPanel();
		contentPane.add(panel, BorderLayout.CENTER);
		
		JButton btnMonetary = new JButton("Monetary");
		btnMonetary.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				try {
					ProgAppsProjectConverter.main(null);
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		});
		panel.add(btnMonetary);
		
		JButton btnMeasurements = new JButton("Measurements");
		btnMeasurements.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				ProgAppsProjectMeasurements.main(null);
			}
		});
		panel.add(btnMeasurements);
		
		JButton btnTemperature = new JButton("Temperature");
		btnTemperature.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent ae) {
				ProgAppsProjectTemperature.main(null);
			}
		});
		panel.add(btnTemperature);
	}

}
